package com.shop.api.feign;

import com.shop.Result.LdbzResult;
import com.shop.pojo.LdbzItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name = "shop-service-item")
public interface ItemSerevice {

    @RequestMapping(value ="/item/service/countItem",method = RequestMethod.GET)
    LdbzResult countItem(LdbzItem entity);
    @RequestMapping(value ="/item/service/getItemPage",method = RequestMethod.GET)
    LdbzResult getItemPage(LdbzItem entity , int pn , int limit) ;
    @RequestMapping(value ="/item/service/getItemList",method = RequestMethod.GET)
    LdbzResult getItemList(LdbzItem entity);

    /**
     * 根据板块Key获取商品列表
     * @param key
     * @return
     */
    @RequestMapping(value ="/item/service/selectItemListBySheetKey",method = RequestMethod.GET)
    LdbzResult selectItemListBySheetKey(String key);
    @RequestMapping(value ="/item/service/selectByKey",method = RequestMethod.GET)
    LdbzResult selectByKey(Long id);
    @RequestMapping(value ="/item/service/selectByCode",method = RequestMethod.GET)
    LdbzResult selectByCode(Long code);
    @RequestMapping(value ="/item/service/deleteByKey",method = RequestMethod.GET)
    LdbzResult deleteByKey(String id);
    @RequestMapping(value ="/item/service/insertByEntity",method = RequestMethod.GET)
    LdbzResult insertByEntity(LdbzItem entity);
    @RequestMapping(value ="/item/service/updateByKey",method = RequestMethod.GET)
    LdbzResult updateByKey(LdbzItem entity);

    /**
     * 获取商品图片
     * @param itemCode
     * @param type 1:商品预览图 ; 2:商品描述详解图
     * @return
     */
    @RequestMapping(value ="/item/service/getItemImageByRedis",method = RequestMethod.GET)
    String getItemImageByRedis(Object itemCode , Object type);
    @RequestMapping(value ="/iem/service/getItemImage",method = RequestMethod.GET)
    String getItemImage(Object itemCode , Object type);

    /**
     * 根据商品编号实时获取价格
     * @param itemCode
     * @return
     */
    @RequestMapping(value ="/item/service/getItemPriceByCode",method = RequestMethod.GET)
    float getItemPriceByCode(long itemCode);
}
